/****************************************************************/
/*  I M P E T U S     C O P Y R I G H T      S T A T E M E N T  */
/****************************************************************/
/*                                                              */
/*  NOTICE: THIS SOFTWARE CONTAINS TRADE SECRETS THAT BELONG TO */
/*          IMPETUS INFOTECH, AND IS LICENSED BY AN AGREEMENT.  */
/*          ANY UNAUTHORIZED ACCESS, USE, DUPLICATION OR        */
/*          DISCLOSURE IS UNLAWFUL.                             */
/*                                                              */
/*          COPYRIGHT (C) 2008 IMPETUS INFOTECH INDIA PVT LTD   */
/*          ALL RIGHTS RESERVED.                                */
/****************************************************************/
package com.iLabs.faces.custom.validators;

import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.validator.Validator;
import javax.faces.validator.ValidatorException;


public class SelectStateValidator implements Validator{
	/** Invalid selection for the menu*/
	private static final String selectState = "Choose a State";

	/** Validator id for SelectMenutValidator */
	private String validatorMessageId = "validate_select_state";


	/* (non-Javadoc)
	 * @see javax.faces.validator.Validator#validate(javax.faces.context.FacesContext, javax.faces.component.UIComponent, java.lang.Object)
	 */
	public void validate(FacesContext context, UIComponent component, Object value) throws ValidatorException {		
		if(selectState.equals((String)value)){
			ValidatorMessageUtils.logValidationMessage(context, component, value, validatorMessageId);			
		}
	}
}